//
//  LoadViewController.m
//  YiLiao
//
//  Created by mac on 16/7/4.
//  Copyright © 2016年 Noah. All rights reserved.
//

#import "LoadViewController.h"

@interface LoadViewController ()<UIImagePickerControllerDelegate,UINavigationControllerDelegate>

@end

@implementation LoadViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc]initWithTitle:@"上传头像" style:UIBarButtonItemStyleDone target:self action:@selector(barButtonActiion:)];
}

-(void)barButtonActiion:(UIBarButtonItem *)bar{
    UIImagePickerController *picker;
    if (picker==nil) {
        picker=[[UIImagePickerController alloc]init];
        
    }
    picker.delegate=self;
    picker.allowsEditing=YES;
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
        picker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
        [self presentViewController:picker animated:YES completion:nil];
    }
}
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary<NSString *,id> *)editingInfo{
    self.imgView.image=image;
    [picker dismissViewControllerAnimated:YES completion:nil];
    UIImage *image1=[editingInfo objectForKey:UIImagePickerControllerOriginalImage];
}
//确定修改
- (IBAction)SureButton:(id)sender {
    
}











@end
